<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.yaodian100.ec.payment.entity.BonusTransfer"%>
<%@page import="java.math.BigDecimal"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<c-rt:set var="frontContextPath" value='<%=ServerValue.getFrontContextPath()%>'/>
<%@page import="org.apache.commons.lang.StringUtils"%>
<html>
<head>
<script language="javascript">
$().ready(function(){
	$("#current_location").html('&nbsp;&gt;&nbsp;我的积分&nbsp;-&nbsp;使用明細');
	$("#use_li").attr('class','mb-tab-f');
	$("#acc_li").removeAttr('class');
	if($("#uTable tr").size()>2){$("#uTable").tablesorter();}
	$("td.txt-rd").each(function(){
		$(this).html('-'+$(this).text()); 
	});
});
</script>
</head>
<body>
<%
@SuppressWarnings("unchecked")
List<BonusTransfer> bonustransferList = (List<BonusTransfer>)request.getAttribute("bonustransferList");
DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd");
BonusTransfer bonusTransfer;
%>
    <!-- 使用明細 -->
      <p class="LH-1of5"></p>
      <p class="bg-yl" align="right">共<%=bonustransferList.size() %>笔</p>
      <table id="uTable" class="tablesorter {sortlist: [[0,1]]} tb-2" width="100%" border="0" class="tb-2">
      <thead>
        <tr>
          <th width="90"><span><a href="javascript:;">使用日期</a></span></th>
          <th><span><a href="javascript:;">摘要</a></span></th>
          <th width="90" "><span><a href="javascript:;">返还积分</a></span></th>
          <th width="90" "><span><a href="javascript:;">使用积分</a></span></th>
        </tr>
      </thead>
      <tbody>
       <%if(bonustransferList.size()==0){ %>
			<tr><td height="30" colspan="7">您没有任何记录。</td></tr>
        <%}else{
        	for(int i = 0 ; i < bonustransferList.size(); i++){
        		bonusTransfer = bonustransferList.get(i);
        %>  
        	<%if(bonusTransfer.getRefoundBonus().compareTo(new BigDecimal(0))!=0) { %>
          <tr>
          <td><%=dateformat.format(bonusTransfer.getCreateDate()) %></td>
          <td><p>商品退货/取消完成，归还积分。 <% if(StringUtils.isNotBlank(bonusTransfer.getOrderId())){ %>(订单编号：<a href="${frontContextPath}/member/order/page.do?page=detail&orderId=<%=bonusTransfer.getOrderId() %>" target="_blank"><%=bonusTransfer.getOrderId() %></a>)<%} %></p></td>
          <td>+<%=bonusTransfer.getRefoundBonus() %></td>
          <td>&nbsp;</td>
          </tr>
          <%} %>
          <% if(bonusTransfer.getUseBonus().compareTo(new BigDecimal(0))!=0){ %>
          <tr>
          <td><%=dateformat.format(bonusTransfer.getCreateDate()) %></td>
          <td><p>折抵订单 <% if(StringUtils.isNotBlank(bonusTransfer.getOrderId())){ %>(订单编号：<a href="${frontContextPath}/member/order/page.do?page=detail&orderId=<%=bonusTransfer.getOrderId() %>" target="_blank"><%=bonusTransfer.getOrderId() %></a>)<%} %></p></td> 
          <td>&nbsp;</td>
          <td class="txt-rd"><%=bonusTransfer.getUseBonus() %></td>
          </tr>
          <%}%>
        <%	}
        }%>
      </tbody>
      </table>
      <p align="right"><a href="#"><span class="a-top"></span>Top</a></p>

	<!-- 注意事项 -->
	<div class="txt-note">
		<ul>
			<li>．使用明细仅显示 6 个月内的资料。</li>
		</ul>
	</div>
	<!-- 注意事项 -->
</body>
</html>